<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
 <head>
    <title>编辑用户信息</title>
   <link rel="stylesheet" href="/admin/css/pintuer.css"/>
   <link rel="stylesheet" href="/admin/css/admin.css"/>
   <link  href="/admin/css/bootstrap-theme.min.css" rel="stylesheet" type="text/css"/>
   <link href="/admin/css/bootstrap.min.css" rel="stylesheet" type="text/css" media="all" />
   <script src="/admin/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
   <script src="/admin/js/bootstrap.min.js" type="text/javascript" charset="utf-8"></script>
   <script src="/admin/js/pintuer.js"></script>
    <style type="text/css">
    	.occupation-box {
    		border:1px solid #ddd; width:300px!important; height:100px; padding:20px;
    	}
    	.occupation-box > label {margin-right:22px;}
    </style>
    <script type="text/javascript" src="/admin/js/ajaxfileupload.js"></script>
    
    <script type="text/javascript">
    function yanzheng(){
    	var name=$("#name").val();
    	var orderby=$("#orderby").val();
    	if($.trim(name)==""){
    		alert("名称不能为空");
    		return;
    	}
    	if($.trim(orderby)!=""&&isNaN(orderby)){
    		alert("顺序号必须为数字");
    		return;
    	}
    	$("#form").submit();
    }
    
    </script> 
</head>
<body>
<div class="panel admin-panel">
  <div class="panel-head"><strong><span class="icon-pencil-square-o"></span>&nbsp;用户信息</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="/admin/user/updateoradd" id="form">
      <div class="form-group">
        <div class="label">
          <label>用户名：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="username" th:value="${user!=null?user.username:''}" size="100" id="name"/>
           <input type="hidden" name="id" th:value="${user!=null ? user.id:''}"/>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>昵称：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="nickname" th:value="${user!=null?user.nickname:''}" size="100" id="name"/>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>密码：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="password" th:value="${user!=null?user.password:''}" size="100" id="name"/>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>电话：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="tel" th:value="${user!=null?user.tel:''}" size="100" id="name"/>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>邮箱：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="email" th:value="${user!=null ? user.email : ''}" size="100" id="name"/>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label>角色：</label>
        </div>
        <div class="field">
          <label>
            <input type="radio" name="role" value="USER" th:checked="${user!=null and user.role == 'USER'}">USER
          </label>
          &nbsp;
          &nbsp;
          &nbsp;
          <label>
            <input type="radio" name="role" value="ADMIN" th:checked="${user!=null and user.role == 'ADMIN'}">ADMIN
          </label>
          <div class="tips"></div>
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button class="button border-main icon-check-square-o" type="submit"> 提交</button>
          <button class="button border-red icon-tags" type="button" onclick="window.history.go(-1);"> 返回</button>
        </div>
      </div>
    </form>
  </div>
</div>
</body>
</html>